from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep, strftime

driver = webdriver.Firefox()
driver.maximize_window()
url = 'file:///C:/Users/TEACHER/Desktop/NSD2405/html/register.html'
driver.get(url)

driver.find_element(By.ID, 'user').send_keys('张三')
# 截屏
driver.get_screenshot_as_file(f'../images/{strftime("%Y_%m_%d_%H_%M_%S")}.png')

sleep(3)
driver.quit()